<template>
  <div>
    <el-card shadow="never" class="card">
      <div style="display: flex; margin-bottom: 20px;">
        <a v-if="item.app_type == 2" v-for="(item,index) in app_list" :key="index" :href="item.doc" target="_blank" style="margin-right: 10px; color:#FFF;">
          <el-button size="small" type="primary">{{item.application_name}}API文档</el-button>
        </a>
      </div>
      <div style="width: 100%;overflow:auto;height: 75vh;" class="markdown-body" v-html="help" v-highlight></div>
    </el-card>
  </div>
</template>
<script>
import {
  getAppDocList,getAppDocHelp
} from '../sys'
import showdown from "showdown";
export default {
  name: 'Menu',
  components:{
    showdown
  },
  data() {
    return {
      help: '',
      app_list: [],
      loading: false,
    };
  },
  mounted() {
    let convert = new showdown.Converter()
    getAppDocHelp().then(res=>{
      this.help = convert.makeHtml(res.data)
    })
    this.loading = true
    getAppDocList().then(res=>{
      this.app_list = res.data
      this.loading = false
    })
  },
};
</script>
<style lang="scss">
@import '@/assets/scss/common.scss';
</style>
